const mongoose = require("mongoose");

let timecapsuleSchema = mongoose.Schema({
    createAt:{
        type:Date,
        default:Date.now()
    },
    authorId : {
        type:String,
        required:true
    },
    openTime:{
        type:Date,
        required:true
    },
    username:{
        type:String
    },
    email:{
        type:String,
        required:true
    },
    content : {
        type:String,
        required:true
    },
    tip:String,
    key: {  // 0dff-a59e-ecca-d2a6-b16c
        type:String,
        required:true
    }
})

let timecapsuleModel = mongoose.model("timecapsule", timecapsuleSchema);

module.exports = timecapsuleModel;